package common.db.io;

import java.io.*;

/**
 * Created by IntelliJ IDEA.
 * User: Paskal
 * Date: May 8, 2009
 * Time: 7:58:35 PM
 * To change this template use File | Settings | File Templates.
 */


public class OutputFile
{

	//private DataOutputStream output;
	private PrintWriter pw;

	public OutputFile(String filename)

	{
		try
		{
			FileWriter fw = new FileWriter(filename);
			pw = new PrintWriter(fw);
		}
		catch (Exception e)
		{
			throw new RuntimeException(e);
		}


	}

//	public void write(String s) throws IOException
//	{
//		output.writeBytes(s);
//	}

	public void writeLine(String s) throws IOException
	{
		pw.println(s);
		pw.flush();
//		output.writeBytes(s);
//		output.writeByte('\n');
//		output.writeByte('\r');
	}

//	public void flush()
//	{
//
//		//output.flush();
//		pw.flush();
//
//	}

	public void close()
	{
		try
		{
			//output.close();
			pw.close();
		}
		catch (Exception e)
		{
			throw new RuntimeException(e);
		}

	}
}
